x

Shared Libraries

A shared library is simply a compiled executable much like a program. They are used by programs pretty much like a normal library, to carry out operations facilitated by its API. However shared libraries are shared so that all the programs making use of the same library need not bundle the entirety of the library with their build. The reason for this is simply to save space.

Shared libraries is the same fashion as executables. In fact, if an executable can provide a symbol table within itself, it can be accessed as an ABI, making it a shared library.

Basically, the compiler compiles the source code and into object files. The linker statically links all the libraries and executables together, leaving the executable

Nowadays, both libraries and programs use the same loaders to keep uniformity. Once both are loaded into the memory, the program can refer to the symbol table and map the ABI endpoints to the memory locations of the shared library.

Needs more clarity.

Related topics

  • Symbol Table
  • Debugging Symbols
  • Shared Memory
  • Position Independent Executables (PIEs)

Guide (on how the linking and loading processes take place):

How shared libraries are loaded in Linux

Notes on Shared Libraries in Apache NuttX RTOS

Left-click: follow link, Right-click: select node, Scroll: zoom
x